<div class="table-bordered border-left margin-bottom20">
  <div class="top-title-container higher">
    <div class="pull-left">
      <h4 class="inline"><%= @job.title %></h4><br/>
      <span class="text-article-info">
        <%= link_to (t "controller.#{controller_name}"), jobs_path %>
        <span class="dot-divider">•</span>
        <%= @job.user.name %>
        <span class="dot-divider">•</span>
        于<%= @job.created_at_from_now %>发布
        <% if @job_comments.any? then %>
            <span class="dot-divider">•</span>
            最后由 <%= @job_comments.last.user.name %> 于<%= @job_comments.last.created_at_from_now %>回复
          <% end %>
        <span class="dot-divider">•</span>
        <%= @job.pageview %>次阅读
      </span>
    </div>
    <%= link_to add_cdn_path(image_tag 'portrait.gif', class: 'thumbnail pull-right portrait', style: 'margin-top: -6px;'), user_path(@job.user) %>
  </div>

  <div class="padding10">
    <!--<p id="notice"><%#= notice %></p>-->
    <p>
      <% if @job.details_available?(current_user?(@job.user)) then  %>
      <h5 style="display:<%= @job.company? ? 'none' : 'block' %>;">
        @<%= @job.company %>
      </h5>
      <%= @job.details.html_safe %>
    <% else %>
      <span class="text-warning">提示：无法查看该文章的具体内容，该文章被设置为私有。</span>
    <% end %>
    </p>
  </div>

  <div class="bottom-title-container">
    <% if signed_in? && current_user?(@job.user) then %>
      <%= link_to add_cdn_path(image_tag 'edit_24.png') + t('common.edit_btn_label'), edit_job_path(@job) %>
      <span class="divider">/</span>
      <%= link_to add_cdn_path(image_tag 'delete_24.png') + t('common.delete_btn_label'), @job, method: :delete, data: {confirm: (t 'common.alert.delete')} %>
      <span class="divider">/</span>
    <% end %>
    <%= link_to add_cdn_path(image_tag 'back_24.png') + '返回', jobs_path %>
  </div>
</div>

<% if @job.job_comments.any? then %>
  <div class="table-bordered border-left">
    <div class="top-title-container text-article-info">
      共收到<%= @job_comments.count %>条回复
      <%= will_paginate @job_comments %>
    </div>

    <% @job_comments.each do |job_comment| %>
      <table class="border-bottom" style="width: 100%;">
        <tr>
          <td class="padding10" style="width: 58px; vertical-align: top; border: 0;">
            <%= link_to add_cdn_path(image_tag 'portrait.gif', class: 'thumbnail portrait'), user_path(job_comment.user) %>
          </td>
          <td style="padding: 10px 10px 10px 0; border: 0;">
            <span class="text-article-info">
              <%= job_comment.user.name %>
              <span class="dot-divider">•</span>
              <%= job_comment.created_at_from_now %>
            </span>
            <br />
            <%= job_comment.details.html_safe %>
          </td>
        </tr>
      </table>
    <% end %>

    <div class="bottom-title-container text-article-info">
      共收到<%= @job_comments.count %>条回复
      <%= will_paginate @job_comments %>
    </div>
  </div>
<% end %>

<% if signed_in? then %>
  <div class="table-bordered border-left padding10 margin-top20">
    <%= render 'shared/comment_form', object: @job, comment: @job_comment %>
  </div>
<% end %>
